home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C ++ / Applications / NeuroSim 1.0.2 / AGA Slider ƒ / Sources / UGrayscaleAppearance.cp < prev    next >
Encoding:
Text File  |  1997-03-19  |  1.2 KB  |  50 lines  |  [TEXT/CWIE]

  1. //
  2. //    UGrayscaleAppearance.cp
  3. //
  4. //    Utilities for supporting the Apple Grayscale Appearance for System 7.5
  5. //
  6. //
  7. //    Copyright © 1996 by James Jennings. All rights reserved.
  8. //
  9.  
  10. // To Check: are these being disposed of?
  11.  
  12. #include "UGrayscaleAppearance.h"
  13. #include <PP_Types.h>
  14. #include <UDebugging.h>
  15.  
  16. void    UGrayscaleAppearance::FrameRect( const Rect &inFrame, 
  17.         EGAColor inTopLeft, EGAColor inBottomRight, EGAColor inCorners)
  18. {    // Draw a frame that gives the "beveled" look.
  19.     // inTopLeft is the color of the top and left edges.
  20.     // inBottomRight is the color of the bottom and right edges.
  21.     // inCorners is the color of the pixels in the bottom-left and top-right corners.
  22.     
  23.     // width and height of the interior of the frame
  24.     Int16 width = inFrame.right - inFrame.left - 2;
  25.     Int16 height = inFrame.bottom - inFrame.top - 2;
  26.     
  27.     Assert_( width >= 0 && height >= 0 );
  28.     
  29.     ::PenSize( 1, 1 );
  30.     
  31.     ::MoveTo( inFrame.left, inFrame.bottom - 1 );
  32.     SetForeColor( inCorners );
  33.     ::Line( 0, 0 );
  34.     
  35.     SetForeColor( inTopLeft );
  36.     ::Move( 0, -1 );
  37.     ::Line( 0, - height );
  38.     ::Line( width, 0 );
  39.     
  40.     SetForeColor( inCorners );
  41.     ::Move( 1, 0 );
  42.     ::Line( 0, 0 );
  43.     
  44.     SetForeColor( inBottomRight );
  45.     ::Move( 0, 1 );
  46.     ::Line( 0, height );
  47.     ::Line( - width, 0 );
  48.     
  49. }
  50.